﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Globalization;

namespace DiscoveryLogic.UI.Layouts.Models
{
    public static class AppResources
    {
        /// <summary>
        /// Gets the string that represents the level of risk
        /// </summary>
        /// <param name="level">THe risk level between 1 and 10</param>
        /// <returns>The risk level string. If the value is outside a known risk band, the unknown risk string is returned</returns>
        public static string GetRiskLevelString(int level)
        {
            string risk = (string)Application.Current.Resources["Res_RiskLevel" + level.ToString(CultureInfo.InvariantCulture)];
            if (risk == null)
                return (string)Application.Current.Resources["Res_RiskLevelUnknown"];
            else
                return risk;
        }

        public static T Get<T>(string key)
        {
            return (T)Application.Current.Resources[key];
        }

        public static string Get(string key, params object[] args)
        {
            return string.Format(Get<string>(key), args);
        }

    }
}
